/*
 * hash.h
 *
 * Version 1.0
 * Author: rtp
 *
 * Description: hash map header
 * We use the linked list,
 * so each cell can have more than one item
 *
 */

#ifndef HASH_H_
#define HASH_H_

#include "linked_list.h"

#define HASHELEMENTS 10007

typedef struct
{
	list* lists;
} hash_map;

typedef hash_map* hash;

//hash function
unsigned int hash_function(char *key);

//creates a new hash map structure
hash hm_create();

//add an element to the hash table
void hm_add(hash t, char* value);

//returns the linked list for a given key
//list->element shall return the value
int hm_find(hash t, char *key);

//removes the content of the table for a key
void hm_del(hash t, char *value);

//provides statistics about table utilization
//might be useful for test different hash functions
void hm_profile(hash t);


#endif
